﻿using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;


public delegate void UpdateSoldierDelegate(SoldierAI ai);

public class SoldierUpdateWorker  {
    readonly AutoResetEvent FinishUpdateFlag;
    readonly ManualResetEvent TerminateFalg;
    int firstIndex, lastIndex;
    private UpdateSoldierDelegate soldierUpdate;
    private Thread thread;


    public void WaitUpdateFinish()
    {
        FinishUpdateFlag.WaitOne();
    }

    public SoldierUpdateWorker(UpdateSoldierDelegate update)
    {
        soldierUpdate = update;
    }

    public void Setup(int first,int last)
    {
        firstIndex = first;
        lastIndex = last;
    }
    public void Start()
    {
        thread = new Thread(Excute);
    }

    public void Excute()
    {

    }
}
